<template>
	<view class="news">
		<news-list @gotodo="navigatorGo" :newsArr="newsArr"></news-list>
	</view>
</template>

<script>
	import newsList from "@/components/news-list/news-list.vue"
	export default {
		data() {
			return {
				newsArr:[]
			}
		},
		methods: {
			async getNews(){
				const res = await this.$myRequest({
					url:'/selectNewsList'
				})
				this.newsArr = res.data
			},
			navigatorGo(id){
				uni.navigateTo({
					url:"/pages/news/news-detail?id="+id
				})
			}
		},
		onLoad(){
			this.getNews();
		},
		components:{
			"news-list":newsList
		}
	}
</script>

<style lang="scss">
	.news{
		
	}
</style>
